* {
    box-sizing: border-box;
}

body {
    display: flex;
    margin: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    background-color: #efedd6;
}

h1 {
    margin: 10px;
}

.box {
    display: flex;
    width: 400px;
    height: 200px;
    margin: 10px;
    border-radius:10px;
    align-items: center;
    justify-content: center;
    background-color: steelblue;
    color: #fff;
    box-shadow: 2px 4px 5px rgb(0, 0, 0, .3);
    transform: translateX(400%);
    transition: transform .4s ease;
}

/* 左右错开 */
.box:nth-of-type(even) {
    transform: translateX(-400%);
}

.box h2 {
    font-size: 45px;
}

.box.show {
    transform: translateX(0);
}